APPNAME = 'moan_test_suite'
VERSION = '0.1'

top = '.'
out = 'build'
executable_name = 'moan2010_test'

def options(ctx):
    ctx.load('compiler_cxx')
    ctx.add_option('--exe', action='store_true', default=False, 
                   help='execute binary after it is built'     )

def post(ctx):
    print('=== executing post tasks ===')
    if ctx.options.exe:
        executable_full_name = out + '/' + executable_name
        print('executing: ' + executable_full_name)
        ctx.exec_command(executable_full_name)
        

def configure(ctx):
    ctx.load('compiler_cxx')
    #ctx.check(execute=True)
    

def build(ctx):
    ctx.add_post_fun(post)
    ctx.program(
        target    = executable_name,
        source    = ['src/moan_test/moan_test.cpp'],
        includes  = ['src', 'thirdparty'],
        lib       = ['pthread'],
        linkflags = ['-g'],
        stlibpath = ['../lib'],
        stlib     = ['gtest_main'],
        cxxflags  = ['-std=c++0x']
        )
